<?php


namespace App\Http\Controllers\Api\Driver;


use App\Http\Controllers\Controller;
use App\Repositories\CommentRepository;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;

class CommentController extends Controller
{



    /**
     * @param Request $request
     * @param CommentRepository $repository
     * @return CommentController|JsonResponse
     * @Author 姿势就是力量
     */
    public function getPageList(Request $request, CommentRepository $repository)
    {
        $driver_id = (int)$request->get('driver_id', '');
        $companyId = (int)$request->get('company_id', '');
        $type = (string)$request->get('type', '0');
        $score = (int)$request->get('score', '');
        $orderSn = (string)$request->get('order_sn', '');
        $pageSize = (int)$request->get('page_size', 10);
        $user_name = (string)$request->get('name', ''); //用户名称
        $nick_name = (string)$request->get('nick_name', '');//用户昵称
        $user_phone = (int)$request->get('user_phone', '');//用户手机号
        $driver_name = (string)$request->get('driver_name', '');//司机名称
        $company_name = (string)$request->get('company_name', '');//公司名称
        $remark =(string)$request->get('remark','');      //备注
        $date =(string)$request->get('created_at','');      //时间选择
        $list = $repository->getPageList($companyId, $orderSn, $user_name, $nick_name,$driver_name,$company_name,$remark,$date,$driver_id, $score,$user_phone, $pageSize,$type);

        return $this->sendJson($list);
    }


}
